package cz.acies.organizer.data.persist;

import java.io.Serializable;
import java.util.HashMap;

public class EmailAddress implements Serializable
{
	private static final long serialVersionUID = 3726304046584372659L;

	public static final int HOME = 0;
	public static final int WORK = 1;
	public static final int OTHER = 2;
	public static final int GENERAL = 3;

	public static HashMap<Integer, String> Rels = new HashMap<Integer, String>();
	static {
		Rels.put(new Integer(HOME), "http://schemas.google.com/g/2005#home");
		Rels.put(new Integer(WORK), "http://schemas.google.com/g/2005#work");
		Rels.put(new Integer(OTHER), "http://schemas.google.com/g/2005#other");
		Rels.put(new Integer(GENERAL), "http://schemas.google.com/g/2005#general");
	}
	public static HashMap<String, Integer> RelsId = new HashMap<String, Integer>();
	static {
		RelsId.put("NTCONDAT07", new Integer(HOME));
		RelsId.put("NTCONDAT01", new Integer(WORK));
		RelsId.put("NTCONDAT14", new Integer(OTHER));
	}

	protected String address;
	protected int rel = HOME;
	protected boolean primary = false;
	
	public EmailAddress(String address) {
		this(address, HOME, false);
	}

	public EmailAddress(String address, int rel, boolean primary) {
		this.address = address;
		this.rel = rel;
		this.primary = primary;
	}

	// -----  -----------------------------------------------------------------
	
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getRel() {
		return rel;
	}

	public void setRel(int rel) {
		this.rel = rel;
	}

	public boolean isPrimary() {
		return primary;
	}

	public void setPrimary(boolean primary) {
		this.primary = primary;
	}
}
